<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="WEB-INF/pager-taglib.tld" prefix="pg" %>

<%
String path = request.getContextPath();
String newPath="";
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+newPath+"/";
%>
    
  <html xmlns="http://www.w3.org/1999/xhtml">
<head>
		<base href="<%=basePath%>" />
		
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="css/magic-bootstrap.css" rel="stylesheet"></link>
		<link href="css/styles.css" rel="stylesheet"></link>
		<link href="css/div.css" rel="stylesheet" type="text/css"></link>
		<link href="css/u4.css" rel="stylesheet" type="text/css"></link>
		
		<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
		<script type="text/javascript" src="js/lavalamp.js"></script>
		<script type="text/javascript" src="js/jquery.js"></script>
		<script type="text/javascript" src="js/bootstrap-dropdown.js"></script>
		<script type="text/javascript" src="js/bootstrap-collapse.js"></script>
		<script type="text/javascript" src="js/bootstrap-tab.js"></script>
	
		<script type="text/javascript" src="js/bootstrap-carousel.js"></script>
	
<script type="text/javascript" >

	alert("w");
	$(document).ready(function(){
	alert("ready");
		$("#saleBtn").click(){alert("ok");};
	});
	
	sale(){
	alert("ok");
	};
</script>
	</head>

<!-- Navigation -->

<%@ include file="header.jsp" %> <!--  导航条 -->

<!-- end of Navigation -->



<div class="main">

<div class="container">

<%@ include file="searchLine.jsp" %> <!--  搜索框 -->


    
<div class="row">	

<!--  Left ------------------------------------------------------------------------------------------------------------------------ -->
	<div class="span3">	
		<%@ include file="left.jsp" %>	<!-- 左边的商品分类和最热商品-->
	</div>
<!--  end of left ------------------------------------------------------------------------------------------------------------------------ -->
	
<!-- Right ------------------------------------------------------------------ -->
<div class="span9">
		<div class="row" style="margin-top:13px;margin-left:20px"><!--图片轮转 row-->
			 <%@ include file="picChange.jsp" %> <!--  图片轮转 -->
		</div><!--  图片轮转row -->
		
		<div class="row" style="margin-left:20px"> <!-- 书籍区row -->
		<!-- newlist -->
			<div class="newlist">

					<s:action name="goodsAction!showNewGoodsInIndex" namespace="/" executeResult="false">
					</s:action>
				  <div class="row">
				   <div class="span9">
					<legend>
						<strong>最新商品</strong>
					</legend>
				   </div>
				  </div>
				  
				  <div class="row">
				   <div class="span9">
					<div class="goodslist">
						<s:iterator value="#request.goodsList" id="goods">

							<div class="item">
								<div class="img">
									<a
										href="goodsAction!showGoods?id=<s:property value='#goods.id'/>">
										<img id="indeximg" src="<s:property value='#goods.pic'/>"></img>
									</a>
								</div>
								<div class="listTitle">
									<a	href="goodsAction!showGoods?id=<s:property value='#goods.id'/>">
										<s:if test="#goods.type==2">
											【求购】
										</s:if>
										 <s:property	value="#goods.name" />
									</a>
								</div>
								<div class="price">
									￥
									<s:property value="#goods.price" />
								</div>
								<s:if test="#goods.type==1">
								<div class="preprice">
									原价：￥
									<s:property value="#goods.oldPrice" />
								</div>
								</s:if>
								<div class="place">
									<s:property value="#goods.place" />
								</div>
							</div>
						</s:iterator>
					</div>
				 </div>
			  </div>
					<!-- end of goods list -->
		</div>
		<!-- newlist -->
		
		<!--  Page  -->
			<div class="row">
				   <div class="span9" style="margin-left:50px">
				   
					<div class="page">

						<p id="page">

				<pg:pager scope="request" maxIndexPages="5" index="center"
						maxPageItems="20" url="goodsAction!showNewGoodsInPage" items="${totalSize}" export="currentPageNumber=pageNumber">
       
       					 <pg:first>
							<a href="${pageUrl}" class="n">首页</a>
						</pg:first>
						<pg:prev>
							<a href="${pageUrl}" class="n">&lt;前一页</a>
						</pg:prev>
						
						<pg:page>
						</pg:page>
						
						<pg:pages>
							
							<c:choose>
								<c:when test="${pageNumber eq currentPageNumber }">
									<strong><span class="fk fk_cur"></span><span class="pc">${pageNumber }</span>
									</strong>
									
								</c:when>
								<c:otherwise>
									<a href="${pageUrl }"><span class="fk fkd"></span><span class="pc">${pageNumber}</span></a>
	  					    	</c:otherwise>
							</c:choose>
						</pg:pages>
						<pg:next>
							<a href="${pageUrl}" class="n">下一页&gt;</a>							
						</pg:next>
						<pg:last>
							<a href="${pageUrl}" class="n">尾页</a>
						</pg:last>
						
						<span class="nums"	style="margin-left:120px">共${totalSize}条记录</span>
					</pg:pager>
					</p>

					</div>
				 </div>
			  </div>
					<!--  end of page -->
		
		</div><!-- 书籍区row -->
		
				
	</div><!-- end of Right --------------------------------------------------------------->
 </div>

</div><!--container-->
</div>

</html>
